package dao

import (
	"database/sql"
	"time"

	_ "github.com/appleboy/gin-jwt"
	jwt "github.com/dgrijalva/jwt-go"
	"gorm.io/gorm"
)

type MyClaims struct {
	UserID   string `json:"id" form:"id"`
	Username string `json:"username" form:"username"`
	Number   string `json:"number" form:"number"`
	jwt.StandardClaims
}

const TokenExpireDuration = time.Hour * 2 //设置过期时间为2h

var MySecret = []byte("夏天悄悄过去")

type UserInfo struct {
	UserID   string `json:"id" form:"id"`
	Username string `json:"username" form:"username"`
	Number   string `json:"number" form:"number"`
}

type User struct {
	ID      string `form:"id" json:"id"`
	Name    string `form:"name" json:"name"`
	Number  string `form:"number" json:"number"`
	Gender  string `form:"gender" json:"gender"`
	Class   string `form:"class" json:"class"`
	College string `form:"college" json:"college"`
	Major   string `form:"major" json:"major"`
	Phone   string `form:"phone" json:"phone"`
	QQ      string `form:"qq" json:"qq"`
	Score   string `form:"score" json:"score"`
	Status  string `form:"status" json:"status"`
}

type AllUser struct {
	Number int    `json:"number"`
	Name   string `json:"name"`
	Class  string `json:"class"`
	Major  string `json:"username"`
	Blog   string `json:"blog"`
	Grade  string `json:"grade"`
	Flag   string `json:"flag"`
}

type Comment struct {
	ID       string    `json:"id" form:"id" `
	Username string    `json:"username" form:"username" `
	Number   string    `json:"number" form:"number" `
	Content  string    `json:"content" form:"content" `
	Time     time.Time `json:"time" form:"time" `
}
type Comment2 struct {
	ID       string `json:"id" form:"id" `
	Username string `json:"username" form:"username" `
	Number   string `json:"number" form:"number" `
	Content  string `json:"content" form:"content" `
	Time     string `json:"time" form:"time" `
}
type SwaggerUserSuccess struct {
	Code int64  `json:"code"`
	Msg  string `json:"msg"`
	User User   `json:"user"`
}

type SwaggerUserFailed struct {
	Code int64  `json:"code"`
	Msg  string `json:"msg"`
}

type Process struct {
	Num     string `json:"num"`
	Title   string `json:"title"`
	Content string `json:"content"`
	Focus   string `json:"focus"`
}

type ShowData struct {
	ID      int    `json:"id"`
	Content string `json:"content"`
	Type    string `json:"type"`
	Img     string `json:"img"`
}

type ShowDataMade struct {
	Yj  int `json:"yj"`
	Yx  int `json:"yx"`
	Web int `json:"web"`
}

type MailBody struct {
	TargetUser string `json:"target_user"`
	Title      string `json:"title"`
	Content    string `json:"content"`
}

type YuQAdmin struct {
	ID int    `json:"id"`
	QQ string `json:"qq"`
}

type AwardList struct {
	ID      int      `json:"id"`
	Name    string   `json:"name"`
	Url     string   `json:"url"`
	Time    string   `json:"time"`
	Team    string   `json:"team"`
	Class   string   `json:"class"`
	Members []string `json:"members"`
}
type TeamMembers struct {
	Name string `json:"name"`
}
type GenderForClasses struct {
	KaiFaMan     int `json:"kai_fa_man"`
	KaiFaWoman   int `json:"kai_fa_woman"`
	ZhiNengMan   int `json:"zhi_neng_man"`
	ZhiNengWoman int `json:"zhi_neng_woman"`
}

type Gender struct {
	Man   int `json:"man"`
	Woman int `json:"woman"`
}

type Music struct{
	ID int `json:"id"`
	Name string `json:"name"`
}

var DB *sql.DB
var GormDB *gorm.DB
